package com.kevin.mybatis.rocketmq;

import org.apache.rocketmq.spring.core.RocketMQTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

@Component
public class ProduceService {

    @Autowired
    private RocketMQTemplate rocketMQTemplate;

    public void sendMessage() {
        for (int i = 0; i < 10; i++) {
            rocketMQTemplate.convertAndSend("java-rocketmq", "HelloWorld" + i);
        }
    }
}
